<template>
  <div class="flex flex-col w-full h-full">
    <nav>
      <router-link to="/">Home</router-link> |
      <router-link to="/form">About</router-link>
    </nav>
    <router-view v-slot="{ Component }">
      <component :is="Component" />
      <!-- 加载中状态 -->
    </router-view>
  </div>
</template>

<script setup>
import { onMounted } from 'vue'
onMounted(() => {
  console.log('App组件已挂载，Suspense应该正常工作')
})
</script>

<style lang="scss" scoped>
.loading-state {
  padding: 30px;
  margin: 30px;
  font-size: 24px;
  font-weight: bold;
  color: white;
  background-color: #42b983;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 80%;
  text-align: center;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
